﻿using Max.PH5_2004A.Shopping.Domain.Shared;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Max.PH5_2004A.Shopping.Domain
{
    /// <summary>
    /// 订单信息
    /// </summary>
    [Table("tb_order")]
    public class OrderModel : AuditField<Guid>
    {
        public string OrderNo { get; set; } //订单号
        public Guid MemberId { get; set; } //会员
        public decimal OrderTotal { get; set; } //订单金额
        public DateTime OrderDate { get; set; } = System.DateTime.UtcNow; //下单时间：国际标准日期
        public OrderStatue OrderStatue { get; set; } = OrderStatue.ToPayment; //订单状态，默认等待付款
        public PayStatue PayStatue { get; set; } = PayStatue.Waiting; //默认待支付
        public PayWay? PayWay { get; set; } //支付方式
        public DateTime? PayTime { get; set; }
        public decimal PayTotal { get; set; } //支付金额
        public decimal DiscountTotal { get; set; } = 0; //折扣金额
        public Guid? CouponDetailId { get; set; } //订单优惠券使用情况（关联相关表）
        public string ReciveName { get; set; } //收件人姓名
        public string RecivePhone { get; set; } //收件人电话
        public string ReciveAddress { get; set; } //收件人地址
        public string? Remark { get; set; } //下单备注说明
    }

    /// <summary>
    /// 订单明细
    /// </summary>
    public class OrderDetailModel:AuditField<Guid>
    {
        public string OrderNo { get; set; }
        public Guid SKUId { get; set; }
        public decimal Price { get; set; }
        public int Number { get; set; }        
    }
}
